package com.ym.medical.domain.vo;


import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ym.base.enums.FlagEnum;
import com.ym.common.annotations.CustomConstraint;
import com.ym.common.constant.BeanCovert;
import com.ym.medical.domain.entity.ConsultSummaryEntity;
import com.ym.medical.domain.entity.InquiryOrderEntity;
import com.ym.medical.domain.entity.PatientHealthRecordsEntity;
import com.ym.medical.enums.InquiryOrderIoTypeEnum;
import com.ym.medical.enums.InquiryOrderSourceEnum;
import com.ym.medical.enums.PaymentWayEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


@Data
@ApiModel(value = "问诊订单和附件信息")
public class OrderAndFileVO extends BeanCovert<InquiryOrderEntity> {
    @ApiModelProperty("问诊订单主键")
    private Long id;

    @ApiModelProperty("用户ID")
    private Long userId;

    @ApiModelProperty("定价实例ID")
    @NotNull
    private Long ruleId;

    @ApiModelProperty("问诊患者id")
    @NotNull
    private Long patientId;

    @ApiModelProperty("订单来源 (01-找医生，02-自诊，03-快速问诊 04-继续咨询)")
    @CustomConstraint(InquiryOrderSourceEnum.class)
    @JsonSerialize(converter = InquiryOrderSourceEnum.Covert.class)
    private String orderSource;

    @ApiModelProperty("病情描述")
    @NotEmpty
    private String illnessDesc;

    @ApiModelProperty("是否线下就诊 (是-01 否-00)")
    @CustomConstraint(FlagEnum.class)
    private String isTreatment;

    @ApiModelProperty("问诊人联系电话")
    private String phoneNo;

    @ApiModelProperty("患病时长")
    private String illnessDuration;

    @ApiModelProperty("过敏史")
    private String allergyHistory;

    @ApiModelProperty("重大疾病,慢病例")
    private String majorDiseases;

    @ApiModelProperty("订单编号")
    private String ioNum;

    @ApiModelProperty("订单类型 (01-图文咨询 02-电话咨询  03-私人医生 04-视频咨询)")
    @CustomConstraint(InquiryOrderIoTypeEnum.class)
    @JsonSerialize(converter = InquiryOrderIoTypeEnum.Covert.class)
    private String ioType;

    @ApiModelProperty("订单类型 (01-图文咨询 02-电话咨询 03-私人医生 04视频咨询)")
    private String ioTypeName;

    @ApiModelProperty("支付方式")
    @CustomConstraint(PaymentWayEnum.class)
    @JsonSerialize(converter = PaymentWayEnum.Covert.class)
    private String paymentWay;

    @ApiModelProperty("支付方式 key='PaymentWayEnum'")
    private String paymentWayName;

    @ApiModelProperty(notes = "应付金额")
    private BigDecimal payableAmount;

    @ApiModelProperty(notes = "实际支付金额")
    private BigDecimal paymentPrice;

    @ApiModelProperty("支付状态 （01-待支付 02-已支付 03-退费申请中 04-已退费 05-订单异常）")
    private String paymentState;

    @ApiModelProperty(notes = "支付来源 (01-小程序 02-公众号)")
    @Size(max = 2 , message = "支付来源 (01-小程序 02-公众号)长度必须在{min}和{max}之间",groups = {Add.class,Update.class})
    private String paySource;

    @ApiModelProperty(notes = "支付时间")
    private Date paymentTime;

    @ApiModelProperty("预约时间规则ID(目前仅视频咨询)")
    private Long appointTimeRule;

    @ApiModelProperty("预约时间(电话咨询)")
    private Date appointTime;

    @ApiModelProperty("1 待接单 2 已接单  3 完成 4 取消 ")
    private String ioState;

    @ApiModelProperty("阅读数")
    private Integer readNum;

    @ApiModelProperty("预付表主键")
    private Long prepaymentId;

    @ApiModelProperty("0 不公开  1 公开")
    private String isPublic;

    @ApiModelProperty("结束时间")
    private Date ioEndtime;

    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty(notes = "付款账户")
    @Size(max = 32 , message = "付款账户长度必须在{min}和{max}之间",groups = {Add.class,Update.class})
    private String payAcc;

    @ApiModelProperty(notes = "01找医生 02 自诊 03 快速问诊")
    private String orderSourceName;

    @ApiModelProperty("是否线下就诊")
    private String isTreatmentName;

    @ApiModelProperty(notes = "支付来源 (01-小程序 02-公众号)")
    private String paySourceName;

    @ApiModelProperty(notes = "0 不公开  1 公开")
    private String isPublicName;

    @ApiModelProperty(notes = "优惠券主键")
    @NotNull(message = "优惠券id 不能为空",groups = CouponUse.class)
    private Long relId;

    @ApiModelProperty("支付备注")
    private String payRemark;


    @ApiModelProperty("附件主键")
    @NotNull(message = "附件主键!")
    private String ids;

    @ApiModelProperty("电话时长")
    private Integer prDuration;

    @ApiModelProperty("患者姓名")
    private String name;

    @ApiModelProperty("医生姓名")
    private String realName;

    @ApiModelProperty("患者头像id")
    private String headUrl;

    @ApiModelProperty("患者性别")
    private String sex;

    @ApiModelProperty("患者年龄")
    private Integer userAge;

    @ApiModelProperty("中间号码")
    private String relationNum;

    @ApiModelProperty("医生电话")
    private String doctPhone;

    @ApiModelProperty("医生id")
    private Long doctId;

    @ApiModelProperty("可否拨打电话标志")
    private Boolean flag;

    @ApiModelProperty("可否拨打电话标志")
    private String dialStatus;

    @ApiModelProperty("评价标志")
    private Boolean evaluationFlag;

    @ApiModelProperty("咨询室id")
    private Long crId;

    @ApiModelProperty("咨询室状态05 已总结")
    private String courState;

    @ApiModelProperty("医生云信id")
    private String replyAccid;

    @ApiModelProperty("录音文件地址")
    private List<RecordAndTimeVo> recordUrl;

    /**
     * 性别值
     */
    @ApiModelProperty("性别值")
    private String sexName;

    @ApiModelProperty("拨打电话记录")
    private List<HuaweiReturnVo> returnParams;

    @ApiModelProperty("健康档案")
    private PatientHealthRecordsEntity patientHealthRecords;

    @ApiModelProperty("咨询总结")
    private ConsultSummaryEntity consultSummary;

    @ApiModelProperty("答谢")
    private MindVo mind;

    @ApiModelProperty("评价")
    private PhoneOrderCommentRecord commentRecord;

    public interface Add {

    }

    public interface Update {

    }

    public interface CouponUse{

    }

}
